
let str = 'hello world!'


/*
const person = (name, age) => {
  return {name: name, age: age}
}*/

// const arr = () => []
// const person = (name, age) => ({name: name, age: age})
// console.log(person('张三', 24))


/*const fullName = (firstName, lastName) => {
  return firstName + lastName
}
console.log(fullName('张', 'san'))*/

// arr.forEach((item, index) => arr[index] = item * 10)
// console.log(arr)

// const sum = (a, b) => a + b
// console.log(sum(1, 99))

// const isOdd = num => num % 2 === 1
// console.log(isOdd(3))

// let arr = [199, 1, 22, 99, 123]
// arr.sort((a, b) => b - a)
// console.log(arr)

const fullName = ({ firstName: f = 'john', lastName: l }) => {
  // console.log(opt)
  // const { firstName, lastName } = opt
  // console.log(firstName, lastName)
  // return opt.firstName + opt.lastName
  // return firstName + lastName
  return f + l
}
console.log(fullName({lastName: 'san'}))

/*const sum = (a, b) => {
  return a + b
}*/

/*const f2 = function (v) {
  return v
}*/

/*
const f2 = function (a, ...oth) {
  console.log(a)
  console.log(arguments)
  // console.log(c)
  // console.log(d)
}

f2(1, 'hha', '99', [])*/

// console.log('17'.padStart(2, '0'))
// console.log('hello'.padStart(10, 'x'))
// console.log('hello'.padEnd(10, 'x'))

// 2021-10-01 09:24:08

// console.log(str.repeat(10))
// console.log(str.startsWith('h'))
// console.log(str.startsWith('H'))
// console.log(str.includes('l'))
// console.log(str.includes('l', 4))
// console.log(str.includes('L'))
// console.log(str.indexOf('l'))
// console.log(str.indexOf('L'))

// console.log('张'.length)
// console.log('𠮷'.length)
// console.log('𠮷'.charAt(0))
// console.log('𠮷'.charAt(1))
// console.log('𠮷'.charCodeAt(0))
// console.log('𠮷'.charCodeAt(1))
// console.log(`hello \\n es6!`)
// console.log(String.raw`hello \n es6!`)

// console.log(String.fromCodePoint(0x20bb7))
// console.log(String.fromCodePoint(0x20bb8))
// console.log(String.fromCharCode(0x20bb7))
// console.log(String.fromCharCode(0x20bb8))

/*
for (let item of str) {
  console.log(item)
}
120
123
*/

// 一石米



